export function scoreOpenState(value) {
    var text = "";
    switch (value) {
        case "AFTER_EXAM_PAPER_SUBMIT":
            text = "试卷提交后";
            break;
        case "AFTER_EXAM_END":
            text = "考试结束后";
            break;
        case "AFTER_OPEN_SCORE":
            text = "分数公开后";
            break;
        case "AFTER_CORRECTION":
            text = "改卷结束后";
            break;

        default:
            break;
    }
    return text;
}

export function examState(value) {
    var text = "";
    switch (value) {
        case "WAIT":
            text = "待考";
            break;
        case "ON":
            text = "考试中";
            break;
        case "WAIT_CORRECTION":
            text = "考试结束待阅卷";
            break;
        case "END_CORRECTION":
            text = "阅卷结束";
            break;

        default:
            break;
    }
    return text;
}

export function trainExamStatus(value) {
    var text = "";
    switch (value) {
        case "CREATE":
            text = "未组卷";
            break;
        case "EDIT":
            text = "已组卷";
            break;
        case "READY":
            text = "开始考试";
            break;

        default:
            break;
    }
    return text;
}
export function studentExamStatus(value) {
    var text = "";
    switch (value) {
        case "CREATE":
            text = "";
            break;
        case "EDIT":
            text = "未组卷";
            break;
        case "READY":
            text = "开始考试";
            break;

        default:
            break;
    }
    return text;
}

export function numFilter(value) {
    var text = "";
    switch (value) {
        case 0:
            text = "A";
            break;
        case 1:
            text = "B";
            break;
        case 2:
            text = "C";
            break;
        case 3:
            text = "D";
            break;
        case 4:
            text = "E";
            break;
        case 5:
            text = "F";
            break;
        case 6:
            text = "G";
            break;
        case 7:
            text = "H";
            break;
        case 8:
            text = "I";
            break;
        case 9:
            text = "J";
            break;
        default:
            break;
    }
    return text;
}

export function arrayFilter(arr) {
    if (!arr) {
        return "";
    }
    var answerArr = [];
    arr.forEach(value => {
        var text = "";
        switch (value) {
            case 0:
                text = "A";
                break;
            case 1:
                text = "B";
                break;
            case 2:
                text = "C";
                break;
            case 3:
                text = "D";
                break;
            case 4:
                text = "E";
                break;
            case 5:
                text = "F";
                break;
            case 6:
                text = "G";
                break;
            case 7:
                text = "H";
                break;
            case 8:
                text = "I";
                break;
            case 9:
                text = "J";
                break;
            default:
                break;
        }
        answerArr.push(text);
    });

    return answerArr.join(",");
}
